Aggregate(TSource) Method (ParallelQuery(TSource), Func(TSource, TSource, TSource))

Task Parallel System.Threading

Applies in parallel an accumulator function over a sequence.

Namespace:  System.Linq
Assembly:  System.Threading (in System.Threading.dll)

Syntax

Visual Basic (Declaration)
Public Shared Function Aggregate(Of TSource) ( _
	source As ParallelQuery(Of TSource), _
	func As Func(Of TSource, TSource, TSource) _
) As TSource
C#
public static TSource Aggregate<TSource>(
	ParallelQuery<TSource> source,
	Func<TSource, TSource, TSource> func
)

Parameters

source
Type: System.Linq..::.ParallelQuery<(Of <(TSource>)>)
A sequence to aggregate over.
func
Type: System..::.Func<(Of <(TSource, TSource, TSource>)>)
An accumulator function to be invoked on each element.

Type Parameters

TSource
The type of the elements of source.

Return Value

The final accumulator value.

Exceptions

ExceptionCondition
System..::.ArgumentNullException source or func is a null reference (Nothing in Visual Basic).
System..::.InvalidOperationException source contains no elements.
System..::.AggregateException One or more exceptions occurred during the evaluation of the query.
System..::.OperationCanceledException The query was canceled.

See Also